﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPIS.GERP.GFMS.MODEL;
using KPIS.GERP.GFMS.IBLL;
using KPIS.GERP.GFMS.IDAL;
using KPIS.GERP.GFMS.DALFactory;

// test only
using KPIS.GERP.GFMS.DAL;

namespace KPIS.GERP.GFMS.BLL
{
    public class B_BGM_MAS_ExpenseGroup : IBLL_BGM_MAS_ExpenseGroup
    {
        Common common = new Common();
        private static readonly IDAL_BGM_MAS_ExpenseGroup dal = DataAccess.Create_BGM_MAS_ExpenseGroup();

        public B_BGM_MAS_ExpenseGroup()
        {

        }

        public IList<M_BGM_MAS_ExpenseGroup> GetFull(string bgm_source_seq, bool bLeafOnly)
        {
            Nullable<int> nbgm_source_seq = common.ConvertNullInt(bgm_source_seq);
            return dal.GetFull(nbgm_source_seq, bLeafOnly);
        }

        public IList<M_BGM_MAS_ExpenseGroup> GetList(string bgm_source_seq)
        {
            Nullable<int> nbgm_source_seq = common.ConvertNullInt(bgm_source_seq);
            return dal.GetList(nbgm_source_seq);
        }

        public M_BGM_MAS_ExpenseGroup GetInfo(string seq)
        {
            int nSeq;

            if (seq == null)
                return null;

            if (common.IsNumeric(seq))
            {
                nSeq = int.Parse(seq);
                return dal.GetInfo(nSeq);
            }
            else
            {
                return null;
            }
        }
    }
}
